
 
 V a r i a b l e   N u m e r i c   S l o t _ M 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r M 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ C o u n t e r R e a d e r O u t M 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ C o u n t e r R e a d e r R e s e t M 0 
 
 
 
 S l o t _ M 0   =   1 
 
 
 
 S l o t _ S e n s o r M 0   =   1 9 
 
 
 
 S l o t _ C o u n t e r R e a d e r O u t M 0   =   2 5 
 
 S l o t _ C o u n t e r R e a d e r R e s e t M 0   =   2 6 
 
 
 
 V a r i a b l e   N u m e r i c   N u m T e s t 
 
 
 
 G o s u b   S C I U S C I A   M 0 
 
 
 
 S t o p 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     F U N C T I O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '   W e   w o r k   w i t h   8 0 0   s t e p s   p e r   t u r n 
 
 '   o n e   s t e p   =   0 . 0 0 1 2 5   o f   t u r n , 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 V a r i a b l e   N u m e r i c   T o l e r a n c e 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t C o u n t e r R e a d e r O u t 
 
 V a r i a b l e   N u m e r i c   F i r s t P o s i t i o n 
 
 V a r i a b l e   N u m e r i c   S e c o n d P o s i t i o n 
 
 
 
 L a b e l   " S C I U S C I A   M 0 " 
 
 	 B u t t o n   5   C o l o r   F l a s h i n g 8   R e d   B l a c k 
 
 	 ' 
 
 	 S l o t M o t o r     =   S l o t _ M 0 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r M 0 
 
 	 S l o t C o u n t e r R e a d e r O u t   =   S l o t _ C o u n t e r R e a d e r O u t M 0 
 
 	 ' 
 
 	 F i r s t P o s i t i o n   =   2 7 0 
 
 	 S e c o n d P o s i t i o n   =   9 0 
 
 	 T o l e r a n c e   =   0 . 2 
 
 	 G o s u b   E x e c u t e S c i u s c i a 
 
 	 B u t t o n   5   C o l o r   A q u a m a r i n e 
 
 R e t u r n 
 
 
 
 
 
 V a r i a b l e   N u m e r i c   E x e c u t e S c i u s c a 1 
 
 L a b e l   E x e c u t e S c i u s c i a 
 
 	 
 
 	 N u m T e s t   =   3 0 0 0 0 0 
 
 	 
 
 	 F o r   E x e c u t e S c i u s c a 1   =   1   T o   N u m T e s t 
 
 	 	 ' 
 
 	 	 S l o t ( S l o t M o t o r )   =   F i r s t P o s i t i o n 
 
 	 	 G o s u b   W a i t M o t o r A n d R e c o v e r y 
 
 	 	 W a i t   S e c o n d s   0 . 5 
 
 	 	 ' 
 
 	 	 S l o t ( S l o t M o t o r )   =   S e c o n d P o s i t i o n 
 
 	 	 G o s u b   W a i t M o t o r A n d R e c o v e r y 
 
 	 	 W a i t   S e c o n d s   0 . 5 
 
 	 	 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 L a b e l   E r r o r R e c o v e r y 
 
 	 ' 
 
 	 ' s 1   =   M e s s a g e   " M I S A L I G N M E N T :   "   +   s 2 
 
 	 s 1   =   " Y E S " 
 
 	 I f   S 1   =   " Y E S " 
 
 	 	 ' G o s u b   " U P D A T E   F I L E " 
 
 	 	 ' 
 
 	 	 v 4   =   S l o t ( S l o t M o t o r ) 
 
 	 	 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t C o u n t e r R e a d e r O u t ) 
 
 	 	 G o s u b   W a i t M o t o r 
 
 	 	 
 
 	 	 S l o t ( S l o t M o t o r )   =   v 4 
 
 	 	 G o s u b   W a i t M o t o r 
 
 	 E l s e 
 
 	 	 E n d 
 
 	 E n d I f 
 
 	 
 
 	 s 2   =   S l o t ( S l o t M o t o r )   -   S l o t ( S l o t C o u n t e r R e a d e r O u t ) 
 
 	 P r i n t   " E R R O R : "   +   s 2 
 
 	 
 
 	 	 	 	 	 	 	 	 	 	 	   ' B r e a k p o i n t 
 
 R e t u r n 
 
 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H o m e   t h e   M o t o r ( S l o t M o t o r )   t o   t h e   S e n s o r ( S l o t S e n s o r ) 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 
 
 V a r i a b l e   N u m e r i c   S l o t S e n s o r 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   t h e   m o t o r ( S l o t M o t o r )   i s   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   W a i t M o t 1 
 
 L a b e l   W a i t M o t o r 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 F o r   W a i t M o t 1   =   1   T o   9 e 9 9 
 
 	 	 I f   A b s ( S l o t ( S l o t M o t o r   +   1 ) )   <   0 . 0 1 
 
 	 	 	 ' E x i t 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 L a b e l   W a i t M o t o r A n d R e c o v e r y 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 F o r   W a i t M o t 1   =   1   T o   9 e 9 9 
 
 	 	 I f   A b s ( S l o t ( S l o t M o t o r   +   1 ) )   <   0 . 0 1 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 N e x t 
 
 	 W a i t   S e c o n d s   0 . 2 
 
 	 I f   A b s ( S l o t ( S l o t M o t o r )   -   S l o t ( S l o t C o u n t e r R e a d e r O u t ) )   > =   T o l e r a n c e 
 
 	 	 G o s u b   E r r o r R e c o v e r y 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 
 
 ' W A T C H   S e q u e n c e C m d 
 
 ' W A T C H   s 1 
 
 ' W A T C H   U C a s e ( S e q u e n c e C m d ) 
 
 